home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / dvx / inc / x11 / xaw / textsrc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  7.4 KB  |  225 lines

  1. /*
  2.  * $XConsortium: TextSrc.h,v 1.4 89/10/31 17:12:42 kit Exp $
  3.  */
  4.  
  5. /***********************************************************
  6. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  7. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  8.  
  9.                         All Rights Reserved
  10.  
  11. Permission to use, copy, modify, and distribute this software and its 
  12. documentation for any purpose and without fee is hereby granted, 
  13. provided that the above copyright notice appear in all copies and that
  14. both that copyright notice and this permission notice appear in 
  15. supporting documentation, and that the names of Digital or MIT not be
  16. used in advertising or publicity pertaining to distribution of the
  17. software without specific, written prior permission.  
  18.  
  19. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  21. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  22. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  23. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  24. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  25. SOFTWARE.
  26.  
  27. ******************************************************************/
  28.  
  29. #ifndef _XawTextSrc_h
  30. #define _XawTextSrc_h
  31.  
  32. /***********************************************************************
  33.  *
  34.  * TextSrc Object
  35.  *
  36.  ***********************************************************************/
  37.  
  38. #include <X11/Object.h>
  39.  
  40. /* Resources:
  41.  
  42.  Name             Class        RepType        Default Value
  43.  ----             -----        -------        -------------
  44.  editType         EditType        XawTextEditType    XawtextRead
  45.  
  46. */
  47.  
  48. /* Class record constants */
  49.  
  50. extern WidgetClass textSrcObjectClass;
  51.  
  52. typedef struct _TextSrcClassRec *TextSrcObjectClass;
  53. typedef struct _TextSrcRec      *TextSrcObject;
  54.  
  55. typedef enum _XawTextScanType {XawstPositions, XawstWhiteSpace, XawstEOL, XawstParagraph, /* Added tag. POHC 91/04/08 */
  56.               XawstAll} XawTextScanType;
  57. typedef enum _highlightType {Normal, Selected }highlightType; /* Added tag. POHC 91/04/08 */
  58. typedef enum _XawTextSelectionMode {XawsmTextSelect, XawsmTextExtend} XawTextSelectionMode; /* Added tag. POHC 91/04/08 */
  59. typedef enum _XawTextSelectionAction {XawactionStart, XawactionAdjust, XawactionEnd} /* Added tag. POHC 91/04/08 */
  60.     XawTextSelectionAction;
  61.  
  62. typedef long XawTextPosition;
  63.  
  64. /*
  65.  * Error Conditions:
  66.  */
  67.  
  68. #define XawTextReadError -1
  69. #define XawTextScanError -1
  70.  
  71. /************************************************************
  72.  *
  73.  * Public Functions.
  74.  *
  75.  ************************************************************/
  76.  
  77. /*    Function Name: XawTextSourceRead
  78.  *    Description: This function reads the source.
  79.  *    Arguments: w - the TextSrc Object.
  80.  *                 pos - position of the text to retreive.
  81.  * RETURNED        text - text block that will contain returned text.
  82.  *                 length - maximum number of characters to read.
  83.  *    Returns: The number of characters read into the buffer.
  84.  */
  85.  
  86. XawTextPosition XawTextSourceRead(/* w, pos, text, length */);
  87. /*
  88. Widget w;
  89. XawTextPosition pos;
  90. XawTextBlock *text;    
  91. int length;        
  92. */
  93.  
  94. /*    Function Name: XawTextSourceReplace.
  95.  *    Description: Replaces a block of text with new text.
  96.  *    Arguments: src - the Text Source Object.
  97.  *                 startPos, endPos - ends of text that will be removed.
  98.  *                 text - new text to be inserted into buffer at startPos.
  99.  *    Returns: XawEditError or XawEditDone.
  100.  */
  101.  
  102. int XawTextSourceReplace (/* w, startPos, endPos, text */);
  103. /*
  104. Widget w;
  105. XawTextPosition startPos, endPos;
  106. XawTextBlock *text;
  107. */
  108.  
  109. /*    Function Name: XawTextSourceScan
  110.  *    Description: Scans the text source for the number and type
  111.  *                   of item specified.
  112.  *    Arguments: w - the TextSrc Object.
  113.  *                 position - the position to start scanning.
  114.  *                 type - type of thing to scan for.
  115.  *                 dir - direction to scan.
  116.  *                 count - which occurance if this thing to search for.
  117.  *                 include - whether or not to include the character found in
  118.  *                           the position that is returned. 
  119.  *    Returns: The position of the text.
  120.  *
  121.  */
  122.  
  123. XawTextPosition XawTextSourceScan(/* w, position, type, dir, count, include*/);
  124. /*
  125. Widget                w;
  126. XawTextPosition       position;
  127. XawTextScanType       type;
  128. XawTextScanDirection  dir;
  129. int               count;
  130. Boolean                  include;
  131. */
  132.  
  133. /*    Function Name: XawTextSourceSearch
  134.  *    Description: Searchs the text source for the text block passed
  135.  *    Arguments: w - the TextSource Object.
  136.  *                 position - the position to start scanning.
  137.  *                 dir - direction to scan.
  138.  *                 text - the text block to search for.
  139.  *    Returns: The position of the text we are searching for or
  140.  *               XawTextSearchError.
  141.  */
  142.  
  143. XawTextPosition XawTextSourceSearch(/* w, position, dir, text */);
  144. /*
  145. Widget                w;
  146. XawTextPosition       position;
  147. XawTextScanDirection  dir;
  148. XawTextBlock *        text;
  149. */
  150.  
  151. /*    Function Name: XawTextSourceConvertSelection
  152.  *    Description: Dummy selection converter.
  153.  *    Arguments: w - the TextSrc object.
  154.  *                 selection - the current selection atom.
  155.  *                 target    - the current target atom.
  156.  *                 type      - the type to conver the selection to.
  157.  * RETURNED        value, length - the return value that has been converted.
  158.  * RETURNED        format    - the format of the returned value.
  159.  *    Returns: TRUE if the selection has been converted.
  160.  *
  161.  */
  162.  
  163. Boolean XawTextSourceConvertSelection(/* w, selection, target, 
  164.                      type, value, length, format */);
  165. /*
  166. Widget w;
  167. Atom * selection, * target, * type;
  168. caddr_t * value;
  169. unsigned long * length;
  170. int * format;
  171. */
  172.  
  173. /*    Function Name: XawTextSourceSetSelection
  174.  *    Description: allows special setting of the selection.
  175.  *    Arguments: w - the TextSrc object.
  176.  *                 left, right - bounds of the selection.
  177.  *                 selection - the selection atom.
  178.  *    Returns: none
  179.  */
  180.  
  181. void XawTextSourceSetSelection(/* w, left, right, selection */);
  182. /*
  183. Widget w;
  184. XawTextPosition left, right;
  185. Atom selection;
  186. */
  187.  
  188. #ifdef XAW_BC
  189. /*************************************************************
  190.  * For Compatibility only.                                   */
  191.  
  192. #define _XtTextSink        _XawTextSink
  193. #define _XtTextSource      _XawTextSource
  194.  
  195. #define XtisOn             XawisOn
  196. #define XtisOff            XawisOff
  197.  
  198. #define XtsmTextSelect     XawsmTextSelect
  199. #define XtsmTextExtend     XawsmTextExtend
  200.  
  201. #define XtactionStart      XawactionStart
  202. #define XtactionAdjust     XawactionAdjust
  203. #define XtactionEnd        XawactionEnd
  204.  
  205. #define XtsdLeft           XawsdLeft
  206. #define XtsdRight          XawsdRight
  207.  
  208. #define XtstPositions      XawstPositions
  209. #define XtstWhiteSpace     XawstWhiteSpace
  210. #define XtstEOL            XawstEOL
  211. #define XtstParagraph      XawstParagraph
  212. #define XtstAll            XawstAll
  213.  
  214. #define XtTextSelectionAction XawTextSelectionAction
  215. #define XtTextSelection       XawTextSelection
  216. #define XtTextScanDirection   XawTextScanDirection
  217. #define XtTextScanType        XawTextScanType
  218.  
  219.  
  220. /*************************************************************/
  221. #endif /* XAW_BC */
  222.  
  223. #endif /* _XawTextSrc_h */
  224. /* DON'T ADD STUFF AFTER THIS #endif */
  225.